
#ifndef KPOWERBOX_SERVER
#define KPOWERBOX_SERVER

#include <QtCore/QList>
#include <QtCore/QObject>
#include <QtCore/QString>

#include <QtGui/QtGui>
#include <QtGui/QWidget>

#include "powerbox.h"


/**
 * A server which displays powerboxes on request
 */
class QPowerBoxServer : public QObject
{
	Q_OBJECT


	public:
	QPowerBoxServer();


	public slots:
	/**
	 * Confirm overwrite with the user.
	 *
	 * @param   filename      the name of the file to be overwritten
	 * @param   parent        the parent window
	 */
	Q_SCRIPTABLE bool confirmOverwrite(QString filename, long long parent);

	/**
	 * Show a file open/save dialog.
	 *
	 * This is a very long list of parameters, but we have to use Qt-friendly
	 * types in order for Qt to do the D-Bus marshalling and unmarshalling for
	 * us.
	 *
	 * @param   operation      what we're doing (see powerbox.h)
	 * @param   title          the title of the dialog box
	 * @param   parent         ID of the parent window (to pop up in front of)
	 * @param   startDir       where to look for files
	 * @param   filter         selection filter (e.g. "*.cpp")
	 * @param   allowMultipleSelections   allow multiple selection
	 *
	 * @return  a list of file names
	 */
	Q_SCRIPTABLE QStringList fileDialog(
		int operation,
		QString title,
		long long parent,
		QString startDir,
		QString filter,
		bool allowMultipleSelections = false);


	private:
	Display* display;
};

#endif

